#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "graph.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
	ui->splitter->setStretchFactor(0, 1);
	ui->splitter->setStretchFactor(1, 3);
	m_browser = new QtTreePropertyBrowser(this);
	ui->browserGroupBox->layout()->addWidget(m_browser);
	ui->graphicsView->setRenderHint(QPainter::Antialiasing, true);
	connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(createGraph()));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::createGraph()
{
	GraphFactory factory;
	Graph *g = factory.createGraph(ui->spinBox->value(), ui->spinBox_2->value());
	ui->graphicsView->setScene(g);
}
